package com.ruoyi.system.domian.service.impl;


import com.ruoyi.system.domian.dao.CdUserMapper;
import com.ruoyi.system.domian.jpa.CdUserJpa;
import com.ruoyi.system.domian.service.CdUserService;


import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Dale Mao    ---多多 Email:453918229@qq.com
 * @description CdUserServiceImpl
 * @date 2021-01-26 13:41
 */
@Service
public class CdUserServiceImpl implements CdUserService {


    @Resource
    CdUserMapper cdUserMapper;




    @Override
    public int addUser(CdUserJpa userJpa) {
        // cdUserMapper.getUser();
        return cdUserMapper.insertSelective(userJpa);
    }

    @Override
    public CdUserJpa getUserInfo(CdUserJpa cdUserJpa) {
        return cdUserMapper.selectOne(cdUserJpa);
    }

    @Override
    public CdUserJpa login(CdUserJpa cdUserJpa) {
        return null;
    }


    @Override
    public CdUserJpa getUserInfoByPhone(String phone) {
        CdUserJpa cdUserJpa=new CdUserJpa();
        cdUserJpa.setPhone(phone);

        cdUserJpa= cdUserMapper.selectOne(cdUserJpa);

        return cdUserJpa;
    }

    @Override
    public CdUserJpa getUserInfoByOpenId(String openId, String unionId) {
            return null;
    }
}
